package com.rework.joss.bsgrid.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.rework.joss.bsgrid.dao.SysUserDAO;
import com.rework.joss.bsgrid.entity.SysUser;

@Transactional
@Service
public class SysUserService {

	@Autowired
	private SysUserDAO sysUserDAO;
	
	public List<SysUser> queryUser(String orderby,Integer limit,Integer offset){
		Map<String,Object> paraMap = new HashMap<String,Object>();
		if(StringUtils.isBlank(orderby)){
			orderby = " id ";
		}
		paraMap.put("orderby", orderby);
		paraMap.put("limit", limit);
		paraMap.put("offset", offset);
		return sysUserDAO.queryUser(paraMap);
	}
	
	public int queryCountUser(){
		return sysUserDAO.queryCountUser();
	}
}
